<?php
class ProductsModule extends CWebModule
{
	public $image	=	array(
		'show'	=>	true,
		'thumbnail'	=>	array(
				'width'	=>	140,
				'height'	=>	0,
		),
		'fitting'	=>	array(
				'width'	=>	600,
				'height'	=>	420,
		),
		'lager'	=>	array(
				'width'	=>	1000,
				'height'	=>	700,
		),
		'url'	=>	'/wwwroot/upload_files/products/',
		'uri'	=>	'wwwroot/upload_files/products/',
	);
	public $catalog_image	=	array(
		'show'	=>	true,
		'thumbnail'	=>	array(
				'width'	=>	100,
				'height'	=>	75,
		),
		'fitting'	=>	array(
				'width'	=>	600,
				'height'	=>	420,
		),
		'lager'	=>	array(
				'width'	=>	1000,
				'height'	=>	700,
		),
		'url'	=>	'/wwwroot/upload_files/products/',
		'uri'	=>	'wwwroot/upload_files/products/',
	);
	public $product_image	=	array(
		'show'	=>	true,
		'thumbnail'	=>	array(
				'width'	=>	160,
				'height'	=>	100,
		),
		'fitting'	=>	array(
				'width'	=>	600,
				'height'	=>	420,
		),
		'lager'	=>	array(
				'width'	=>	1000,
				'height'	=>	700,
		),
		'url'	=>	'/wwwroot/upload_files/product_images/',
		'uri'	=>	'wwwroot/upload_files/product_images/',
	);
	public $category_image	=	array(
		'show'	=>	true,
		'thumbnail'	=>	array(
				'width'	=>	160,
				'height'	=>	100,
		),
		'fitting'	=>	array(
				'width'	=>	600,
				'height'	=>	420,
		),
		'lager'	=>	array(
				'width'	=>	1000,
				'height'	=>	700,
		),
		'url'	=>	'/wwwroot/upload_files/product_categories/',
		'uri'	=>	'wwwroot/upload_files/product_categories/',
	);
	public $price	=	array(
		'show'	=>	true,
	);
	public $special_price	=	array(
		'show'	=>	false,
	);
	public $description	=	array(
		'show'	=>	true,
	);
	public $content	=	array(
		'show'	=>	true,
	);
	public $quantity	=	array(
		'show'	=>	true,
	);
	public $style	=	array(
		'show'	=>	true,
	);
	public $product_date	=	array(
		'show'	=>	false,
	);
	public $is_special	=	array(
		'show'	=>	true,
	);
	public $catalogImg = array(
		'url'	=>	'/wwwroot/upload_files/product_categories/',
		'uri'	=>	'wwwroot/upload_files/product_categories/',
	);
	public $entriesAlbumShowGrid = 10;
	public $entriesImageShowGrid = 10;
	public $appLayout = 'application.views.layouts.main';
    /**
     * @var int entries new show in page
     */
    public $entriesShow = 21;
    
    /**
     * @var int entries new show in page
     */
    public $entriesShowInEditPage = 10;
    
    /**
     * @var int entries other new show in page
     */
    public $entriesOtherNews = 10;

    public function init()
    {
        // this method is called when the module is being created
        // you may place code here to customize the module or the application
        // import the module-level models and components
        $this->setImport(array(
            'products.models.*',
            'products.components.*',
            'products.widgets.*',
        ));
    }

    public function beforeControllerAction($controller, $action)
    {
        if (parent::beforeControllerAction($controller, $action)) {
            // this method is called before any module controller action is performed
            // you may place customized code here
            return true;
        }
        else
            return false;
    }

    /**
     * @param $str
     * @param $params
     * @param $dic
     * @return string
     */
    public static function t($str='',$params=array(),$dic='user') {
    	return Yii::t("UserModule.".$dic, $str, $params);
    }
}
